package com.zyh.day02.keyvalue

import org.apache.spark.rdd.RDD
import org.apache.spark.{SparkConf, SparkContext}

object MapValuesTest {
  def main(args: Array[String]): Unit = {
    val conf: SparkConf = new SparkConf()
      .setAppName("m")
      .setMaster("local[*]")
    val sc = new SparkContext(conf)
    val rdd1: RDD[(Int,String)] = sc.makeRDD(List((1,"a"),(1,"d"),(2,"b"),(3,"c")))
    val rdd2: RDD[(Int, String)] = rdd1.mapValues(v => v + "_x")
    rdd2.foreach(println)

    sc.stop()
  }
}
